#include <stdio.h>


int j;
int diego;
void procedimento(int k) {
   int i;
   for ( i = 1; i <= k; i++ ) 
      printf("%d\n", i );
}


int funcao(int k) {
   int i;
   for ( i = 1; i <= k; i++ ) 
      printf("%d\n", i );
}


int test(int n, int i) {
   return ((n / i) == 0) || (((n - 1   ) % i) == 0);
}


void main() {
   int n;
   int i;
   int ok;
   int _i;
   scanf("%d", &_i);
   i = _i;
   diego = test(n, i);
   ok = 1;
   while ( i < n )
   {
      if ( test(n) ) 
         ok = 0;
         i = i + 1;
   }
   if ( ok ) 
      printf("%d\n", 1 );
   else
      printf("%d\n", 0 );
}


